<template>
  <div>
    <div class="Login">
      <div class="Login_BOX">
        <!-- <p>欢迎注册</p>
        <p>严选商城</p> -->
        <h2>
          登录账号
        </h2>
        <p>虾米-严选商城欢迎您</p>
      </div>
      <div>
        <el-input placeholder="手机号码" v-model="mobile" clearable class="Login_input">
        </el-input>
        <el-input placeholder="密码" v-model="pwd" show-password class="Login_input">
        </el-input>
        <el-button type="success" plain class="Login_but" @click="OnLogin">登录</el-button>
        <p class="Login_P">忘记密码</p>
        <p class="Login_P_bottom">
          <a href="#">还没有注册？立即注册</a>
        </p>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      pwd: "",
      mobile: "",
    };
  },methods:{
      OnLogin(){
       this.$Acc.Yanxuan_Login({
           params:{
              pwd:this.pwd,
              mobile:this.mobile
           }
       }).then(res=>{
          var token = res.data.data.token;
          //把获取的token 保存在本地
          localStorage.setItem("token", token);
          alert("登录成功");
          this.$router.push("/mime");
       })
      
      }
  }
};
</script>、
<style  scoped>
.Login_BOX {
  margin-top: 5rem;
  width: 100%;
  height: 5rem;
  margin-left: 5rem;
  font-size: 1rem;

}
.Login {
  width: 100%;
  height: 40rem;
}
.Login_input{
    width: 70%;
    margin-left: 15%;
}
.Login_but{
    margin-top: 2rem;
    width: 50%;
    margin-left: 25%;
}
.Login_P
{
  width: 100%;
  text-align: center;
  font-size: 14px;
  color: grey;
  margin-top: 20px;
}
.Login_P_bottom
{
  width: 100%;
  text-align: center;
  margin-top: 20px;
}
</style>